package domain;

import java.util.Objects;

public class Car {
    private int id;
    private String carnumber;
    private String type;
    private int isnew;
    private int isrepair;

    public Car(int id, String carnumber, String type, int isnew, int isrepair) {
        this.id = id;
        this.carnumber = carnumber;
        this.type = type;
        this.isnew = isnew;
        this.isrepair = isrepair;
    }

    public Car() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCarnumber() {
        return carnumber;
    }

    public void setCarnumber(String carnumber) {
        this.carnumber = carnumber;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getIsnew() {
        return isnew;
    }

    public void setIsnew(int isnew) {
        this.isnew = isnew;
    }

    public int getIsrepair() {
        return isrepair;
    }

    public void setIsrepair(int isrepair) {
        this.isrepair = isrepair;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Car car = (Car) o;
        return id == car.id && isnew == car.isnew && isrepair == car.isrepair && Objects.equals(carnumber, car.carnumber) && Objects.equals(type, car.type);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, carnumber, type, isnew, isrepair);
    }

    @Override
    public String toString() {
        return "Car{" +
                "id=" + id +
                ", carnumber='" + carnumber + '\'' +
                ", type='" + type + '\'' +
                ", isnew=" + isnew +
                ", isrepair=" + isrepair +
                '}';
    }
}
